set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Bundle 'croaky/vim-colors-github'
Bundle 'danro/rename.vim'
Bundle 'majutsushi/tagbar'
Bundle 'kchmck/vim-coffee-script'
Bundle 'kien/ctrlp.vim'
Bundle 'pbrisbin/vim-mkdir'
Bundle 'scrooloose/syntastic'
Bundle 'slim-template/vim-slim'
Plugin 'fatih/vim-go'
Plugin 'Valloric/YouCompleteMe'
Plugin 'SirVer/ultisnips'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'suan/vim-instant-markdown'
Plugin 'sjl/gundo.vim'
Plugin 'elzr/vim-json'
Plugin 'othree/xml.vim'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-notes'
Bundle 'vim-ruby/vim-ruby'
Bundle 'vim-scripts/ctags.vim'
Bundle "scrooloose/nerdtree"
Bundle "Lokaltog/vim-powerline"
Bundle "msanders/snipmate.vim"
Bundle "jelera/vim-javascript-syntax"
Bundle "altercation/vim-colors-solarized"
Bundle "othree/html5.vim"
Bundle "xsbeats/vim-blade"
Bundle "Raimondi/delimitMate"
Bundle "groenewege/vim-less"
Bundle "Lokaltog/vim-easymotion"
Bundle "tomasr/molokai"
Bundle "klen/python-mode"
" For git log
Plugin 'Shougo/unite.vim'
" vimproc 必须要，可能还需要执行 make， 请阅读官方说明: https://github.com/Shougo/vimproc.vim
Plugin 'Shougo/vimproc'
Plugin 'chemzqm/unite-git-log'
Plugin 'flazz/vim-colorschemes'
Plugin 'ekalinin/Dockerfile.vim'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
let g:go_version_warning = 0
""For golang usage""""""""""""""""""""""
" - 新起一行输入fmt.，然后ctrl+x, ctrl+o，Vim 会弹出补齐提示下拉框，不过并非实时跟随的那种补齐，
"   这个补齐是由gocode提供的。
" – 输入一行代码：time.Sleep(time.Second)，执行:GoImports，Vim会自动导入time包。
" – 将光标移到Sleep函数上，执行:GoDef或命令模式下敲入gd，Vim会打开$GOROOT/src/time/sleep.go中 的Sleep函数的定义。执行:b 1返回到hellogolang.go。
" – 执行:GoLint，运行golint在当前Go源文件上。
" – 执行:GoDoc，打开当前光标对应符号的Go文档。
" – 执行:GoVet，在当前目录下运行go vet在当前Go源文件上。
" – 执行:GoRun，编译运行当前main package。
" – 执行:GoBuild，编译当前包，这取决于你的源文件，GoBuild不产生结果文件。
" – 执行:GoInstall，安装当前包。
" – 执行:GoTest，测试你当前路径下地_test.go文件。
" – 执行:GoCoverage，创建一个测试覆盖结果文件，并打开浏览器展示当前包的情况。
" – 执行:GoErrCheck，检查当前包种可能的未捕获的errors。
" – 执行:GoFiles，显示当前包对应的源文件列表。
" – 执行:GoDeps，显示当前包的依赖包列表。
" – 执行:GoImplements，显示当前类型实现的interface列表。
" – 执行:GoRename [to]，将当前光标下的符号替换为[to]。
"
""""""""""""""""""""""""
call unite#custom#profile('gitlog', 'context', {
  \  'start_insert': 0,
  \  'no_quit': 1,
  \  'vertical_preview': 1,
  \ })
nnoremap <silent> <space></space>l  :<C-u>Unite -buffer-name=gitlog   gitlog<cr>

set nu
set ic
set smartindent
syntax on
syntax enable
"colorscheme desert
"colorscheme delek
"colorscheme zellner
"colorscheme molokai
colorscheme OceanicNext
"colorscheme Monokai
"colorscheme space-vim-dark
"hi Comment cterm=italic
set t_Co=256
set background=dark
"set background=dark
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
set showcmd
set autowrite
filetype plugin on
filetype indent on
""""""""""""""""""""""
"set mouse=a
set sm
"set cin
set fileencodings=utf-8,gb2312,gbk,big5
set fileencoding=utf-8
set enc=utf-8
set incsearch
set hlsearch
""""""""""""""""""""""
"manual           手工定义折叠
"indent             更多的缩进表示更高级别的折叠
"expr                用表达式来定义折叠
"syntax             用语法高亮来定义折叠
"diff                  对没有更改的文本进行折叠
"marker            对文中的标志折叠
set foldmethod=indent "set default foldmethod
"zi 打开关闭折叠
"zv 查看此行
"zm 关闭折叠
"zM 关闭所有
"zr 打开
"zR 打开所有
"zc 折叠当前行
"zo 打开当前折叠
"zd 删除折叠
"zD 删除所有折叠
""""""""""""""""""""""
set path +=/usr/lib/qt-3.3/include/*,/usr/local/Trolltech/Qt-4.5.2/include/*
set path+=/home/andyli/unix/include/,/home/andyli/unix/lib/
set path+=/usr/include/,/usr/include/c++/4.3.2/
"""""""""""""""""""""
nmap q :q!<CR>
nmap w :w!<CR>
nnoremap <silent> <F7> :w!<CR>:make<CR>
""""""""""""""""""""""""""
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
"""""""""""""""""""""""""""""""""""""""""
let g:winManagerWindowLoayout='FileExplorer|TagList'
nmap wm :WMToggle<CR>
:set cscopequickfix=s-,c-,d-,i-,t-,e-
""""""""""""""""""""""""""""""""""""""
nmap <C-_>i :csfind i <C-R>=expand("<cfile>")<CR><CR>
""""""""""""""""""""""""""""""""""""""
let g:miniBufExplMapCTabSwitchBufs=1
let g:miniBufExplMapWindowNavVim=1
let g:miniBufExplMapWindowNavArrows=1 
" setting for js
let g:SimpleJsIndenter_BriefMode = 1
""seting for list
"let g:slimv_swank_cmd = '! xterm -e sbcl --load ~/.vim/slime/start-swank.lisp &'
"""""""""""""""""""""""""""""""""""""""
nnoremap <silent> <F11> :!ctags -Ra<CR>
nnoremap <silent> <F5> :A<CR>
nmap <F10> :NERDTreeToggle<CR>
"""""""""""""""""""""""""""""""""""""""
nnoremap <silent> <F3> :Grep -rn<CR>

"""""""""""""""""""""""""""""""""""""""
nmap wv        <C-w>v
nmap ws        <C-w>s
nmap wc        <C-w>c
"goto the function...
nmap gt    <C-]>
"go back
nmap gb   <C-t>
"goto next buffer
nmap gn  :bn<CR>
"""""""""""""""""""""""""""""""""""""""
inoremap <F8> <C-x><C-o>
filetype plugin indent on
set completeopt=longest,menu
"let g:SuperTabRetainCompletionType=2
"let g:SuperTabDefaultCompletionType="<C-x><C-o>"
"""""""""""""""""""""""""""""""""""""""
let g:pydiction_location = '~/.vim/autoload/complete-dict'
"""""""""""""""""""""""""""""""""""""""""""""""
if has("autocmd")
	autocmd Filetype java setlocal omnifunc=javacomplete#Complete
	autocmd Filetype java setlocal completefunc=javacomplete#CompleteParamsInfo
	autocmd FileType python set omnifunc=pythoncomplete#Complete
endif
" auto close the seach window after serach
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" When editing a file, always jump to the last known cursor position.
" " Don't do it when the position is invalid or when inside an event handler
" " (happens when dropping a file on gvim).
" " Also don't do it when the mark is in the first line, that is the default
" " position when opening a file.
  autocmd BufReadPost *
      \ if line("'\"") > 1 && line("'\"") <= line("$") |
   \   exe "normal! g`\"" |
   \ endif
